//
//  InformationTableViewCell.m
//  gamebox_qpp
//
//  Created by 赵隆杰 on 2021/12/11.
//

#import "InformationTableViewCell.h"

@interface InformationTableViewCell ()

@property (weak, nonatomic) IBOutlet UIImageView *imageview;
@property (weak, nonatomic) IBOutlet UILabel *titleLabel;
@property (weak, nonatomic) IBOutlet UILabel *subtitleLabel;

@property (weak, nonatomic) IBOutlet UILabel *timeLabel;


@end

@implementation InformationTableViewCell

- (void)awakeFromNib {
    [super awakeFromNib];
    // Initialization code
    
    self.imageview.layer.cornerRadius = 5;
    self.imageview.layer.masksToBounds = YES;
}

- (void)setModel:(InformationModel *)model
{
    _model = model;
    [self.imageview yy_setImageWithURL:[NSURL URLWithString:model.messagePic] placeholder:placeholder_image];
    
    self.titleLabel.text = [NSString stringWithFormat:@"%@", model.messageName];
    self.subtitleLabel.text = [NSString stringWithFormat:@"%@", model.messageSubtitle];
    NSString *timeStr = [NSDate timeStringToInterval:model.createTime.doubleValue dataFormat:@"yyyy-MM-dd HH:mm"];
    self.timeLabel.text = [NSString stringWithFormat:@"%@", timeStr];
}

@end
